package top.zlcode.common.core.context;

import top.zlcode.common.core.constants.Constants;
import top.zlcode.common.core.utils.ThreadLocalUtil;

public class UserContextHelper {

    /**
     * 获取当前登录用户id
     * @return
     */
    public static Long getUserId() {
        return ThreadLocalUtil.get(Constants.LOGIN_USER_ID, Long.class);
    }

    /**
     * 获取当前登录用户的用户key
     * @return
     */
    public static String getUserKey() {
        return ThreadLocalUtil.get(Constants.USER_KEY, String.class);
    }
}
